package ligne2vie.topos.client.maps.listeners;

import com.google.gwt.maps.client.base.InfoWindow;
import com.google.gwt.maps.client.event.EventCallback;

/**
 * The class {@link CloseInfoWindowOnClick} allows closing an opened info window by clicking on it.
 * 
 * @author thuguerre
 * @since 1.0.0
 */
public class CloseInfoWindowOnClick extends EventCallback {

	private InfoWindow infoWindow;

	/**
	 * Default constructor.
	 * 
	 * @param infoWindow
	 *            Info window to close on click.
	 */
	public CloseInfoWindowOnClick(InfoWindow infoWindow) {
		this.infoWindow = infoWindow;
	}

	/**
	 * {@inheritDoc}
	 */
	@Override
	public void callback() {
		infoWindow.close();
	}

}
